home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 19
/
Mac Magazin and MacEasy Magazine CD - Issue 19.iso
/
Utilities
/
uae-0.4
/
Source Code
/
CPU Sources
/
cpuD.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-13
|
43KB
|
1,404 lines
#include "config.h"
#include "amiga.h"
#include "options.h"
#include <stdlib.h>
#include "memory.h"
#include "custom.h"
#include "newcpu.h"
#include "cputbl.h"
void op_d000(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = regs.d[srcreg];
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d010(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d018(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ regs.a[srcreg] += (srcreg == 7) ? 2 : 1;
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_d020(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= (srcreg == 7) ? 2 : 1;
{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_d028(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d030(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}}
void op_d038(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d039(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d03a(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_d03b(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}}
void op_d03c(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = nextiword();
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_d040(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d048(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.a[srcreg];
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d050(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d058(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[srcreg] += 2;
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_d060(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_d068(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d070(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}}
void op_d078(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d079(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d07a(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_d07b(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}}
void op_d07c(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = nextiword();
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_d080(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d088(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.a[srcreg];
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d090(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d098(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[srcreg] += 4;
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_d0a0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_d0a8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d0b0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}}
void op_d0b8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d0b9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d0ba(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_d0bb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}}
void op_d0bc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = nextilong();
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_d0c0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0c8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.a[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0d0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0d8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[srcreg] += 2;
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d0e0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d0e8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0f0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_d0f8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0f9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d0fa(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d0fb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_d0fc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = nextiword();
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d100(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = regs.d[srcreg];
{ BYTE dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((BYTE)(newv)) < 0;
bool flgo = ((BYTE)(1)) < 0;
bool flgn = ((BYTE)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((BYTE)(newv)) == 0;
regs.n = ((BYTE)(newv)) < 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_d108(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= (srcreg == 7) ? 2 : 1;
{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ regs.a[dstreg] -= (dstreg == 7) ? 2 : 1;
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((BYTE)(newv)) < 0;
bool flgo = ((BYTE)(1)) < 0;
bool flgn = ((BYTE)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((BYTE)(newv)) == 0;
regs.n = ((BYTE)(newv)) < 0;
put_byte(dsta,newv);
}}}}}}}}}
void op_d110(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_d118(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ regs.a[dstreg] += (dstreg == 7) ? 2 : 1;
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}
void op_d120(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ regs.a[dstreg] -= (dstreg == 7) ? 2 : 1;
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}
void op_d128(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_d130(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}}
void op_d138(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_d139(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = nextilong();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(~dst)) < ((UBYTE)(src));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_d140(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ WORD dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((WORD)(newv)) < 0;
bool flgo = ((WORD)(1)) < 0;
bool flgn = ((WORD)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((WORD)(newv)) == 0;
regs.n = ((WORD)(newv)) < 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_d148(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[dstreg] -= 2;
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((WORD)(newv)) < 0;
bool flgo = ((WORD)(1)) < 0;
bool flgn = ((WORD)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((WORD)(newv)) == 0;
regs.n = ((WORD)(newv)) < 0;
put_word(dsta,newv);
}}}}}}}}}
void op_d150(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_d158(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ regs.a[dstreg] += 2;
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}
void op_d160(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ regs.a[dstreg] -= 2;
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}
void op_d168(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_d170(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}}
void op_d178(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_d179(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = nextilong();
WORD dst = get_word(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(~dst)) < ((UWORD)(src));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_d180(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((LONG)(newv)) < 0;
bool flgo = ((LONG)(1)) < 0;
bool flgn = ((LONG)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((LONG)(newv)) == 0;
regs.n = ((LONG)(newv)) < 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_d188(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[dstreg] -= 4;
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((LONG)(newv)) < 0;
bool flgo = ((LONG)(1)) < 0;
bool flgn = ((LONG)((newv+1))) < 0;
if ((flgs && flgo && !flgn) || (!flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && flgo) || (!flgn && (flgo || flgs))) regs.c = regs.x = 1;
newv++;
}} regs.z = ((LONG)(newv)) == 0;
regs.n = ((LONG)(newv)) < 0;
put_long(dsta,newv);
}}}}}}}}}
void op_d190(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_d198(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ regs.a[dstreg] += 4;
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}
void op_d1a0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ regs.a[dstreg] -= 4;
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}
void op_d1a8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_d1b0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}}
void op_d1b8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_d1b9(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = nextilong();
LONG dst = get_long(dsta);
{ ULONG newv = dst + src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs == flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(~dst)) < ((ULONG)(src));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_d1c0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1c8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.a[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1d0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1d8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[srcreg] += 4;
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d1e0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d1e8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1f0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_d1f8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1f9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}
void op_d1fa(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}
void op_d1fb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_d1fc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = nextilong();
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst + src;
regs.a[dstreg] = (newv);
}}}}}